package org.mayanjun.code.dalint;

import org.mayanjun.code.dalmeta.entity.PersistableEntity;
import org.mayanjun.code.dalmeta.query.Query;

import java.util.List;

/**
 * Standard EntityAccessor
 *
 * @author mayanjun(2/26/16)
 * @since 0.0.5
 */
public interface EntityAccessor {

    <T extends PersistableEntity> List<T> query(Query<T> query);

    <T extends PersistableEntity> T queryOne(Query<T> query);

    int update(PersistableEntity bean);
    int update(PersistableEntity bean, Query<? extends PersistableEntity> query);
    long save(PersistableEntity bean);
    int delete(PersistableEntity bean);
    int delete(Query<? extends PersistableEntity> query);
    <T extends PersistableEntity> T getExclude(PersistableEntity bean, String... excludeFields);
	<T extends PersistableEntity> T getInclude(PersistableEntity bean, String... includeFields);

}
